package com.hx.springboot1.dao;

import com.hx.springboot1.pojo.entity.TabUserRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserRoleDao {
    @Select("SELECT * FROM tab_user_role WHERE user_id = #{userId}")
    List<TabUserRole> selectByUserId(int userId);
    @Delete("delete from tab_user_role where user_id = #{userId}")
    int delUserRoles(int userId);
    @Insert("insert into tab_user_role(user_id,role_id)" +
            " values(#{userId},#{roleId})")
    int insertUserRoles(int userId,int roleId);
}
